//
//  changePhoneNumberViewController.m
//  ZHIDOU
//
//  Created by 向礼 on 2018/12/25.
//  Copyright © 2018 向礼. All rights reserved.
//

#import "changePhoneNumberViewController.h"
#import "MCCountDownView.h"
#import "PhoneChangeSuccessViewController.h"


@interface changePhoneNumberViewController ()
@property (weak, nonatomic) IBOutlet UIView *CodeBGView;
@property (weak, nonatomic) IBOutlet UIButton *confirmBtn;
@property (weak, nonatomic) IBOutlet UITextField *NewPhoneTextFiled;
@property (weak, nonatomic) IBOutlet UITextField *CodeNumberTextFlied;
@property(nonatomic ,strong)MCCountDownView *codeView;
@end

@implementation changePhoneNumberViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUpSubView];
}

#pragma mark - UI
-(void)setUpSubView{
    _confirmBtn.layer.cornerRadius = 25 * ZD_defaultScale;
    _confirmBtn.layer.masksToBounds = YES;
  // _confirmBtn.userInteractionEnabled = NO;
    [self setUpVerificationCodeViewFrame:CGRectMake(0, 0 , 125*ZD_defaultScale, 55*ZD_defaultScale)];
}
- (IBAction)phoneChange:(UITextField *)sender {
    
}

- (IBAction)CodeChange:(UITextField *)sender {
   
}
- (IBAction)PushSuccess:(id)sender {
    PhoneChangeSuccessViewController * phoneSuccess = [[PhoneChangeSuccessViewController alloc]init];
    [self.navigationController pushViewController:phoneSuccess animated:YES];
}

//验证码
- (void)setUpVerificationCodeViewFrame:(CGRect)frame
{
    _codeView = [[MCCountDownView alloc] initWithFrame:frame];
    _codeView.bgColor = [UIColor whiteColor];
    _codeView.defaultTitle = @"获取验证码";
    _codeView.originTitleColor = [UIColor blackColor];
    _codeView.dynamicTitleColor = [UIColor blackColor];
    _codeView.maxTimeNum = 60;
    [_CodeBGView addSubview:_codeView];
    __weak __typeof(self)wself = self;
    [_codeView beginClickCodeView:^(MCCountDownView *v) {
//
//        if([wself.rechargeMoneyFild.text rangeOfString:@"."].location != NSNotFound){
//            NSString *lastStr = [[wself.rechargeMoneyFild.text componentsSeparatedByString:@"."] lastObject];
//            if (lastStr.length > 2) {
//                [SVProgressHUD showWarningWithTitle:@"只能保留2位小数" inView:self.view];
//                return;
//            }
//        }
//
//
//        [wself purchaseOrder];
//
    } countBlock:^(NSInteger count) {
    }];
}


@end
